package com.jihu.design.behavioral.visitor;

/**
 * 小爱机器人
 * @author jihu
 * @date 2021/10/12
 */
public class XiaoAi {

    private CPU cpu = new CPU("武汉天气");
    private Disk disk = new Disk("武汉天气");
    private Foot foot= new Foot("武汉天气");

    void answerQuestion(){
        cpu.work();
        disk.work();
        foot.work();
    }


    public void acceptUpdate(Vistor updatePackage) {
        updatePackage.visitCPU(cpu);
        updatePackage.visitDisk(disk);
        updatePackage.visitFoot(foot);
    }
}
